<template>
    <div>
        <el-container>
            <el-main class="home-main-view">
                <router-view />
            </el-main>
        </el-container>
    </div>
</template>
<script>
import store from '@/store/index.js'
import {openUrl, checkIsUrl} from '@/utils/index'

export default {
    name: 'Home',
    data() {
        return {
            menuIndex: null,
            menuRouters: [
                {
                    routerPath: 'https://gitee.com/TDuckApp/tduck-platform?time=1',
                    title: '免费模板'
                },
                {
                    routerPath: 'https://gitee.com/TDuckApp/tduck-platform',
                    title: '开源项目'
                },
                {
                    routerPath: 'https://gitee.com/TDuckApp/tduck-platform/issues',
                    title: '提出建议'
                }
            ]
        }
    },
    computed: {
        getStore() {
            return store
        },
        getUserInfo() {
            // let user = JSON.parse(this.getStore.getters['user/userInfo'])
            let user = {}
            return user
        }
    },
    mounted() {
        this.menuIndex = this.$route.path
    },
    methods: {
        activeMenuHandle(routerPath) {
            if (checkIsUrl(routerPath)) {
                openUrl(routerPath)
            } else {
                this.menuIndex = routerPath
            }
        },
        logoutHandle() {
            this.$confirm('您确定要退出登录吗？', '退出确认', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                // this.$store.dispatch('user/logout').then(() => {
                //     router.push({
                //         path: '/login',
                //         query: {
                //             redirect: router.currentRoute.fullPath
                //         }
                //     })
                // })
            }).catch(() => {

            })
        }
    }
}
</script>
<style lang="scss" scoped>

    .menu-item {
        line-height: 80px;
        height: 80px;
        text-align: left;
        font-weight: 550;
        color: rgba(32, 91, 181, 100);
        font-size: 20px;
        &:hover {
            cursor: pointer;
        }
    }
    .el-menu.el-menu--horizontal {
        border-bottom: none;
    }
    .home-header-view {
        line-height: 92px;
        height: 92px;
        min-width: 1024px;
        background-color: rgba(255, 255, 255, 100);
        color: rgba(16, 16, 16, 100);
        font-size: 14px;
        text-align: center;
        .header-logo-img {
            width: 90%;
            height: 90%;
            float: left;
        }
    }
    .user-person-menu {
        .nick-name {
            height: 16px;
            color: rgba(70, 70, 70, 86);
            font-size: 14px;
            line-height: 16px;
            text-align: left;
        }
        .person-menu-item {
            color: rgba(70, 70, 70, 86);
            font-size: 14px;
            text-align: left;
        }
        .person-menu-item:hover {
            cursor: pointer;
            color: rgba(32, 91, 181, 100);
        }
        .person-menu-divider {
            background-color: rgba(210, 210, 210, 78);
            border: 1px solid rgba(210, 210, 210, 78);
        }
    }
    .user-avatar {
        width: 50px;
        height: 50px;
        border-radius: 100px;
        cursor: pointer;
    }
    .home-main-view {
        height: 100vh;
        min-width: 1024px;
        background-color: #f7f7f7;
        padding: 25px 0 25px 0;
    }
</style>
